﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SIGCBI.Entities;
using SIGCBI.Repository;
using Microsoft.Practices.Unity;

namespace SIGCBI.BusinessLogic
{
    public interface IUserProfileBL
    {
        List<UserProfile> GetAllFromUserProfile();

        List<UserProfile> GetAllFromUserProfileByNombre(string userName);

        UserProfile GetOneUserProfileByUserName(string userName);

        UserProfile GetFromUserProfileById(Int32 id);

        void RemoveUserProfile(Int32 id);
    }

    class UserProfileBL : IUserProfileBL
    {
        [Dependency]
        public IUserProfileRepository userProfileRepository { get; set; }

        public List<UserProfile> GetAllFromUserProfile()
        {
            return userProfileRepository.GetAllFromUserProfile();
        }

        public List<UserProfile> GetAllFromUserProfileByNombre(string userName)
        {
            return userProfileRepository.GetAllFromUserProfileByNombre(userName);
        }

        public UserProfile GetOneUserProfileByUserName(string userName)
        {
            return userProfileRepository.GetOneUserProfileByUserName(userName);
        }

        public UserProfile GetFromUserProfileById(int id)
        {
            return userProfileRepository.GetFromUserProfileById(id);
        }

        public void RemoveUserProfile(int id)
        {
            userProfileRepository.RemoveUserProfile(id);
        }
    }
}
